<template>
  <div>

    <el-row class="bread-nav">
      <ul class="bread-nav-title">
        <span>历史开奖结果</span>
      </ul>
      <ul class="bread-nav-right" v-if="game">
        <span>彩种: </span>
        <select v-model="game">
          <option v-for="(item,index) in gameOption" :value="item.value" :key="index">
            {{item.label}}
          </option>
        </select>
        <span>日期: </span>
        <div class="block">
          <el-date-picker
            v-model="date"
            type="date"
            size="mini"
            placeholder="选择日期"
            :default-value="defaultDate">
          </el-date-picker>
        </div>
      </ul>
    </el-row>

  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'notice',
  methods: {
    GetGameOptions() {
      this.$store.dispatch('GetGameOptions')
        .then(response => {
          for (const key in response) {
            if (key !== 'message') {
              const temp = {
                label: response[key],
                value: key,
              }
              this.gameOption.push(temp)
            }
          }
          this.game = this.gameOption[0].value
        })
    },
  },
  data() {
    return {
      defaultDate: '',
      date: '', // 日期
      game: '', // 彩种
      gameOption: [],
    }
  },
  created() {
    this.defaultDate = new Date()
    this.GetGameOptions()
  },
  computed: { ...mapGetters(['info']) },
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .bread-nav{
    min-height:40px;
    font-size: 13px;
    line-height: 40px;
    background: #ECEFF2;
    border-bottom: 1px solid #d0dff2;
    padding: 0 0 0 10px;
    overflow: hidden;
  }
  .bread-nav-title{
    color:#386399;
    font-weight: bold;
    float: left;
    background: url("../../../../static/agent/img/tb.png") no-repeat left center;
    padding-left: 20px;
  }
  .bread-nav-right{
    float: right;
  }
  .block{
    float: right;
    height:40px;
  }
</style>
